Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kafkareceiver] Add Azure Resource Log Support #28626

Conversation

cparkins
Copy link
Contributor

Description:

Add support for the Azure Resource Log format so that Diagnostic logs from Azure can be consumed by a Kafka Receiver.

Link to tracking Issue:
#18210

Testing:
Local testing to ensure that data is being converted correctly when Streaming from Azure Diagnostic Settings to Event Hubs and using the Kafka Receiver.

Documentation:
Added a bullet for the added azure format.

Copy link
Contributor

@atoulme atoulme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@mx-psi
Copy link
Member

mx-psi commented Nov 15, 2023

@cparkins can you update to Go 1.21 and run make gotidy again? There are some differences in go mod tidy between Go 1.20 and Go 1.21 related to cloud.google.com/metadata.

@cparkins cparkins force-pushed the receiver/kafka-receiver/add-azure-resource-log-support branch from 3cffc47 to 8988316 Compare November 21, 2023 19:32
@github-actions github-actions bot added the processor/resourcedetection Resource detection processor label Nov 21, 2023
@cparkins cparkins force-pushed the receiver/kafka-receiver/add-azure-resource-log-support branch from 2f08c58 to 5e53194 Compare November 21, 2023 21:47
@cparkins
Copy link
Contributor Author

@mx-psi I've rebased to remove the modifications made by running make gotidy.

"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure"
)

type AzureResourceLogsUnmarshaler struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be exported

Suggested change
type AzureResourceLogsUnmarshaler struct {
type azureResourceLogsUnmarshaler struct {

@@ -42,6 +42,7 @@ The following settings can be optionally configured:
- `raw`: (logs only) the payload's bytes are inserted as the body of a log record.
- `text`: (logs only) the payload are decoded as text and inserted as the body of a log record. By default, it uses UTF-8 to decode. You can use `text_<ENCODING>`, like `text_utf-8`, `text_shift_jis`, etc., to customize this behavior.
- `json`: (logs only) the payload is decoded as JSON and inserted as the body of a log record.
- `azureresourcelogs`: (logs only) the payload is converted from Azure Resource Logs format to OTel format.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be azure_resource_logs instead for consistency in the casing style?

@mx-psi mx-psi merged commit 4255836 into open-telemetry:main Dec 7, 2023
83 checks passed
@github-actions github-actions bot added this to the next release milestone Dec 7, 2023
jayasai470 pushed a commit to jayasai470/opentelemetry-collector-contrib that referenced this pull request Dec 8, 2023
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Add support for the Azure Resource Log format so that Diagnostic logs
from Azure can be consumed by a Kafka Receiver.

**Link to tracking Issue:** <Issue number if applicable>
open-telemetry#18210 

**Testing:** <Describe what testing was performed and which tests were
added.>
Local testing to ensure that data is being converted correctly when
Streaming from Azure Diagnostic Settings to Event Hubs and using the
Kafka Receiver.

**Documentation:** <Describe the documentation added.>
Added a bullet for the added azure format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants